# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=py3-dbusmock
_pyname=python-dbusmock
pkgver=0.31.1
pkgrel=1
pkgdesc="Mock D-Bus objects for tests"
url="https://github.com/martinpitt/python-dbusmock"
arch="noarch"
license="LGPL-3.0-or-later"
depends="dbus py3-dbus py3-gobject3"
makedepends="python3-dev py3-setuptools"
checkdepends="bash py3-nose py3-pytest"
_pypiprefix="${_pyname%${_pyname#?}}"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"

build() {
	python3 setup.py build
}

check() {
	# Skip the fakeroot tests as they can't run under our fakeroot environment
	# https://github.com/martinpitt/python-dbusmock/issues/46
	env -u LD_PRELOAD python3 -m unittest
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
}

sha512sums="
5d409e979046cf301c5f8604b43c67abba111315d40e54b59cc5ff6e8fe3bb006591fdac877f750b3a0d56f840337f136b99dda9237de1b00718ef85a3bfcf7b  python-dbusmock-0.31.1.tar.gz
"
